package ipad.asia.service.shopCart;

import ipad.asia.entity.ShoppingCart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@Component
@FeignClient(value = "PROVIDER-CONSUMER")
public interface ShopCartFeign {
    /**
     * 查看自己的购物车
     * @return
     */
    @RequestMapping("/consumer/cart")
     List<ShoppingCart> getCart(@RequestParam(value = "consumerId",required = false) int consumerId);

    @RequestMapping("/consumer/cart/deleteByProductId")
     void deleteByProductIdAndConsumerId(@RequestParam(value = "productId",required = false) int productId,
                                               @RequestParam(value = "consumerId",required = false) int consumerId);


    /**
     * 清空购物车
     */
    @RequestMapping("/consumer/cart/deleteAll")
     void deleteAll();

    /**
     * 将商品加入购物车
     * @param consumerId
     * @param productId
     * @param shopId
     * @param count
     */
    @RequestMapping("/consumer/cart/add")
     void CartAdd(@RequestParam(value = "consumerId",required = false)int consumerId,
                        @RequestParam(value = "productId",required = false)int productId,
                        @RequestParam(value = "shopId",required = false)int shopId,
                        @RequestParam(value = "count",required = false)int count);
}
